Skip to content

#11776 - Publish All EnergyPlus Documentation Using ReadTheDocs - #11780

Open
jmarrec wants to merge 47 commits into
developfrom
html_doc
Open

jmarrec wants to merge 47 commits into
developfrom
html_doc

Conversation

@jmarrec

@jmarrec jmarrec commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Pull request overview

Description of the purpose of this PR

Add targets to build the latex documentation as HTML via pandoc, and hook it to readthedocs.

A version targeting this branch was added to RTD to demo the changes:

https://energyplus.readthedocs.io/en/html_doc/

(it's hidden from the version picker and search results on purpose)

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jmarrec jmarrec self-assigned this Sep 3, 2026
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus Documentation Related primarily on the LaTeX-based EnergyPlus documentation labels Sep 3, 2026
  template_chunked.html

  - Line 97-101: Replaced the non-functional <form> search with a styled button that opens a Bootstrap modal, showing a Ctrl K keyboard hint
  - Lines 134-152: Added a Bootstrap modal with search input, results list, empty state, and hint text
  - Lines 226-227: Added Fuse.js v7.1.0 via CDN (defer)
  - Lines 291-413: Added the search engine JavaScript:
    - Fetches search-index.json and builds a Fuse index on page load
    - Ctrl+K / Cmd+K and / keyboard shortcuts to open
    - 150ms debounced fuzzy search, top 20 results
    - Match highlighting using <mark> tags
    - Arrow key navigation + Enter to select
    - Modal clears state on close

  style.css (new section before scrollable navbar)

  - Search trigger button styling with kbd shortcut hint
  - Modal body max-height for scrollability
  - Search result items with active border highlight
  - Match <mark> styling with warning-colored background
…h requires serving from a server like python http or npx serve)
Replaces deprecated `\rm` with `\mathrm` in mathematical expressions across the documentation. pandoc to html didn't like \rm
Replace verbose `\raisebox` and `\mathord` constructs for fractions with the standard `\frac` command. This improves the readability and semantic correctness of the LaTeX source, facilitating better maintainability and consistent rendering across documentation tools.
Replace verbose `\mathord` constructs for fractions with the standard `\frac` command. This improves the readability and semantic correctness of the LaTeX source, facilitating better maintainability and consistent rendering across documentation tools, especially for HTML conversion.
Replace non-standard math symbol commands (`\rlap{--}`, `\smallint`) with standard LaTeX (`\overline`, `\int`), use `\textrm` for upright text within math mode instead of `\textup` or `\textnormal`, and remove extraneous manual spacing (`\kern 1pt`, `\;`). This improves semantic correctness, readability, and consistent rendering across documentation tools, particularly for HTML conversion.
All 4 PDFs (engineering-reference, input-output-reference, external-interfaces-application-guide, output-details-and-examples) compiled with zero errors.

## Session summary

Starting from the `html_docs` CMake wiring, this turned into a full sweep of every pandoc math-rendering warning across the doc set. Final state: **0 warnings**, all touched PDFs verified to still compile cleanly in `xelatex`.

Fixes applied, roughly in the order tackled:
- `\rm{...}` / `{\rm X}` / `\bf{...}` (legacy plain-TeX font switches) → `\mathrm{}`/`\mathbf{}`/`\textrm{}`/`\textbf{}` depending on math vs. text context — caught and corrected a regression where blind `\mathrm` substitution broke 4 text-mode usages (`\mathrm` only works in math mode).
- `{\mathop{\rm X}\nolimits}` → `\operatorname{X}` (20 files).
- `\medmuskip`/`\thinmuskip`/etc. register hacks inside `\begin{equation}` → moved outside into an enclosing `{...}` group (14 occurrences, 6 files).
- Diagonal-fraction Word artifacts (`\raise...\hbox{}...\vphantom{}...\lower...\hbox{}` and the bare `\mathord{\left/{\vphantom{}}\right.}` variant) → `\frac{}{}`, including nested cases handled via iterative passes (93 occurrences total); one doubly-nested fraction-of-fractions in `generators.tex` hand-rewritten.
- `\textnormal`/`\textup`/`\textsubscript`/`\smallint` → `\textrm{}`/`_{\text{}}`/`\int` (mode-checked, one text-mode `\textsubscript` correctly left alone).
- `{\kern Npt}` spacing hacks → removed (60 occurrences, 8 files).
- `\rlap{--} \dot V` (ASME volumetric-flow notation) → `\overline{\dot V}` (16 occurrences, 2 files).
- `\emph{}` inside math → `\textit{}`, scoped only to math contexts via a context-tracking scanner (137 occurrences, 3 files) — left thousands of legitimate prose `\emph` untouched.
- Stray `\\` artifacts left inside subscripts/superscripts from Word conversion → removed (28+ occurrences across ~12 files), carefully excluding legitimate `\substack{...\\...}` line breaks.
- `\genfrac{}{}{0pt}{2}{A}{B}` → `\substack{A\\B}` (3 occurrences).
- A genuinely obscure pandoc parser quirk: any equation ending in a single bare token immediately before `\label{}` fails to parse — fixed by wrapping that trailing token in `{}` (12 equations, isolated via bisection since it wasn't documented anywhere).
- A `\footnote{}` embedded inside a math `array` environment (invalid placement) — relocated the footnote to the explanatory prose sentence preceding the equation.

The CMake/HTML-build wiring itself (from earlier in the session) is unaffected by any of this — `BUILD_HTML_DOCS=ON` still produces `html/index.html` + one subdirectory per doc, each with its own chunked pages, search index, and styling, matching the PDF pipeline's structure.
…lename

 https://github.com/jmarrec/EnergyPlus/actions/runs/27832002956/job/82370826883

  Run actions/upload-artifact@v7
  With the provided path, there will be 1377 files uploaded
  Artifact name is valid!
  Root directory input is valid!
  Error: The path for one of the files in artifact is not valid: /input-output-reference/1.4-sec:api-usage.html. Contains the following character:  Colon :

  Invalid characters include:  Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n

  The following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential
  problems with downloads on different file systems.
367a856 fixed the same, but it was pre-rebase.

- **`\begin{array}{*{20}{c}}`** (Word's repeated-column macro, unsupported by pandoc's texmath parser) → replaced with a literal `\begin{array}{ccc}` (max columns needed across all occurrences was 3) in:
  - `doc/engineering-reference/.../window-calculation-module.tex`
  - `doc/engineering-reference/.../radiant-system-models.tex`
  - `doc/engineering-reference/.../zone-equipment-and-zone-forced-air-units.tex`
  - `doc/input-output-reference/.../group-location-climate-weather-file-access.tex`
- **`\rm{...}`** (legacy plain-TeX font switch, same class of fix as `367a85622c`) → `\mathrm{...}` in `doc/input-output-reference/.../group-internal-gains-people-lights-other.tex`
- **`\min\!\Bigl(...\Bigr)`** → pandoc's texmath doesn't support `\Bigl`/`\Bigr`; changed to `\bigl`/`\bigr` (matching the `\bigl`/`\bigr` already used elsewhere in the same file) in `doc/engineering-reference/.../ice-thermal-storage.tex`

These are all new equations that came in from `develop` during the rebase — none of these files were touched by the original `367a85622c` fixup commit, so they'd never gone through that pass. A from-scratch rebuild of `output-details-and-examples`, `engineering-reference`, and `input-output-reference` now completes with 0 warnings.
…nce Makefile target to test locally the full site
@JasonGlazer

Copy link
Copy Markdown
Contributor

Would it be possible to enable PDF and epub downloads from ReadTheDocs? I would like to keep an offline copy of each doc.

@mitchute

Copy link
Copy Markdown
Collaborator

PDFs are posted separately on each release, and that will remain the same. I'm unsure how necessary epub would be.

@mitchute

Copy link
Copy Markdown
Collaborator

Also, a reminder that we also update energyplus.net with the PDF docs each release, so maybe we can just make an obvious link to that: https://energyplus.net/documentation

@mitchute

Copy link
Copy Markdown
Collaborator

@JasonGlazer take another look. We'll be tweaking on this thing for a while, but I've fixed a few things today.

Regarding AI converting our graphics to something "better" - my limited experience with that on this project is that it's likely to struggle. We probably just need a prioritized list of the worst offending figures, and then I can start working on it bit by bit with my graphics person.

@JasonGlazer

Copy link
Copy Markdown
Contributor

I was a bit more organized this morning and reviewed a bunch of the more commonly used documents. For the shorter ones, I tried to look at most pages, and for the larger ones, I looked at a sample of pages. This was far from exhaustive but I did find some more issues that could probably be addressed.

General

None of the documents have section numbering, but I think that is the intent. Overall, the section numbering probably doesn’t matter, but differentiating between levels is not as obvious now without it. Perhaps the various heading levels need a more distinctive difference so the user understands when they are done with a section, subsection, or sub-subsection.

https://energyplus.readthedocs.io/en/html_doc/guides/input-output-reference/1.1-whats-different-about-energyplus-input-and-output.html

For lots of tables, the header row is being repeated. Here are some examples:

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/1.3-bcvtb-examples.html (Table 1.3)

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/1.4-coupling-energyplus-with-functional-mock-up-units-for-co-simulation.html (Table 1.4)

https://energyplus.readthedocs.io/en/html_doc/guides/output-details-and-examples/2.1-output-file-list.html (Table 2.1 and 2.2)

https://energyplus.readthedocs.io/en/html_doc/guides/using-energyplus-for-compliance/1.3-tabular-summary-reports.html

https://energyplus.readthedocs.io/en/html_doc/guides/input-output-reference/1.9-group-surface-construction-elements.html#constructions---inheriting-surface-constructions-instead-of-hard-assigning-them (Table 1.14)

https://energyplus.readthedocs.io/en/html_doc/guides/engineering-reference/5.1-climate-calculations.html (Table 5.1)

Again, the many pixelated images are annoying. Since there is no quick fix for these, the next best option would be to force them to be a little smaller so the pixelation is not so obvious since most images default to being the full page width.

Each page has an advertisement at the bottom. Given that this is a DOE-sponsored project and should probably not be appearing to endorse anything, maybe it would make sense to disable ads, perhaps even paying the nominal fee each month to do so.

The "Object Index" pages are new. This is really not an “object index” but just a list of subheadings. It is confusing for most of the documents except the IOref

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/3-object-index.html

https://energyplus.readthedocs.io/en/html_doc/guides/output-details-and-examples/5-object-index.html

https://energyplus.readthedocs.io/en/html_doc/guides/using-energyplus-for-compliance/2-object-index.html

Text that should be in the boxed source code style but isn't appears in lots of places. For example some “XML syntax” are not in source code style blocks (although it was not in PDF either).

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/1.3-bcvtb-examples.html

Home Page

The user guides maybe should just be:

  • Input Output Reference
  • Engineering Reference
  • External Interfaces Application Guide
  • Output Details and Examples
  • Plant Application Guide

With the following that are really out of date maybe called “Other Guides” or “Older Documentation”

  • Getting Started
  • Module Developer
  • Interface Developer
  • Using EnergyPlus for Compliance

I’m not as sure about “External Interfaces Application Guide,” but I think it could probably be considered out of date.

Also, near the top it says: “New to EnergyPlus? Begin with the Quick Start Guide or the Getting Started guide.” But this should probably refer to the "EnergyPlus Essentials" instead of the "Getting Started Guide" since that was intended as the replacement.

External Interfaces Application Guide

Equations are not numbered (although they were not in PDF either):

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/1.2-coupling-energyplus-with-the-building-controls-virtual-test-bed.html

Equations look different than PDF (although probably better):

https://energyplus.readthedocs.io/en/html_doc/guides/external-interfaces-application-guide/1.4-coupling-energyplus-with-functional-mock-up-units-for-co-simulation.html

image

in the PDF they looked wrong:

image

Output Details and Examples

eplusout.bnd example not in source code style (although it was not in PDF either)

https://energyplus.readthedocs.io/en/html_doc/guides/output-details-and-examples/2.3-eplusout.bnd.html

This is the case for other pages also.

Part of eplusout.err text in the code box is shown as comment text in light gray but should not be

In general, the auto-coloring for code boxes seems a little weird in this document.

https://energyplus.readthedocs.io/en/html_doc/guides/output-details-and-examples/2.11-eplusout.err.html

Really ugly chart (but it was that way in the PDF)

https://energyplus.readthedocs.io/en/html_doc/guides/output-details-and-examples/2.22-epluszsz.ext.html

Plant Application Guide

This graphic is too zoomed in and difficult to understand the workflow:

https://energyplus.readthedocs.io/en/html_doc/guides/plant-application-guide/5-inputting-the-system-into-the-idf-file.html

Same issue here:

https://energyplus.readthedocs.io/en/html_doc/guides/plant-application-guide/8-example-system-3-primarysecondary-pumping.html

Input Output Reference

A page like “Group – Thermal Zone Description/Geometry” is really too long to be practical. For now it is ok but perhaps a page-only table of contents at the top would help people get to the portion that they want. The same TOC that appears in the index for each page would be great. Another option is to break it up into smaller pages. Even better would be some more text at the top introducing what the group is supposed to be about and what can be found, and maybe some discussion of why a user would pick between alternative input objects and how all the input objects in the group are related to one another (if they reference each other).

https://energyplus.readthedocs.io/en/html_doc/guides/input-output-reference/1.10-group-thermal-zone-descriptiongeometry.html

Occasionally, a table or graph is way too large, such as on this page under Maximum Cycling Rate.

https://energyplus.readthedocs.io/en/html_doc/guides/input-output-reference/2.2-group-hvac-templates.html#hvactemplatezonewatertoairheatpump

Engineering Reference

Multiple “Simulation Models – Encyclopedic Reference” in the TOC:

https://energyplus.readthedocs.io/en/html_doc/guides/engineering-reference/index.html

Fortran here:

https://energyplus.readthedocs.io/en/html_doc/guides/engineering-reference/1.4-simulation-manager.html

Too big of a figure, Figure 3.17

https://energyplus.readthedocs.io/en/html_doc/guides/engineering-reference/3.8-infrared-radiation-transfer-material.html

Longer Term Fixes

I did not proofread during the review but did notice places that could be written better and especially where a topic is not really introduced well. Perhaps a technical editor should make a pass through the most important documents and, from a reader's point of view, make suggestions on specific improvements. With documentation that has been developed over the course of so many years by so many authors, it might make sense to step back and figure out how it can be organized and improved.

Almost all pages in the Engineering Reference have references at the bottom, but only a small fraction of them link to the documents that they are citing. It would be some effort, but perhaps worth it, to add links. For the older documents, it would be good to scan them and make them available.

@mitchute

Copy link
Copy Markdown
Collaborator

I did not proofread during the review but did notice places that could be written better and especially where a topic is not really introduced well. Perhaps a technical editor should make a pass through the most important documents and, from a reader's point of view, make suggestions on specific improvements. With documentation that has been developed over the course of so many years by so many authors, it might make sense to step back and figure out how it can be organized and improved.

This is one thing that I do think AI is actually pretty good at. We can ask it to review the implementation in the code, and update the docs so they are accurate and the language flows. The biggest bottleneck with this approach are the real life humans that have to review, verify, and accept the changes. Either way, we would need to take it in chunks, but it's still worthwhile to clean some of this up, IMO.

@mitchute

Copy link
Copy Markdown
Collaborator

Each page has an advertisement at the bottom. Given that this is a DOE-sponsored project and should probably not be appearing to endorse anything, maybe it would make sense to disable ads, perhaps even paying the nominal fee each month to do so.

I just updated the settings to disable paid ads, which still allows community ads. We'll look into the paid, add-free route.

@mitchute

mitchute commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

For lots of tables, the header row is being repeated.

addressed here: 3326fcb


the many pixelated images are annoying. Since there is no quick fix for these, the next best option would be to force them to be a little smaller

addressed here: 07136ba


Equations are not numbered (although they were not in PDF either):

They are elsewhere... I'll see what happened in this doc.


Equations look different than PDF (although probably better):

addressed here: e42b282


Home Page suggestions are addressed here: 18b5cad

@mitchute

Copy link
Copy Markdown
Collaborator

Approaching last call on this one. If there are any showstoppers on this, please speak up soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Defect Includes code to repair a defect in EnergyPlus Documentation Related primarily on the LaTeX-based EnergyPlus documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish All EnergyPlus Documentation Using ReadTheDocs

5 participants